package cn.it.shop.service.impl;

import java.util.Set;

import org.hibernate.classic.Session;
import org.springframework.stereotype.Service;

import cn.it.shop.pojo.Privilege;
import cn.it.shop.pojo.Role;
import cn.it.shop.service.RoleService;

@Service("roleService")
public class RoleServiceImpl extends BaseServiceImpl<Role> implements
		RoleService {
	// 通过角色ID查询,角色信息,级联抓去权限信息
	public Role getFetchPid(int id) {
		return roleDao.getFetchPid(id);
	}

	@Override
	public void updateOnlyRole(Role role) {
		roleDao.updateOnlyRole(role);
	}

	@Override
	public String[] getRoleId(Set<Role> roleSet) {
		String[] myId=new String[roleSet.size()];
		int num=0;
		for(Role temp:roleSet){
			myId[num++]=temp.getId().toString();
		}
		return myId;
	}
}
